<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="java.util.*"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<% String baseURL = request.getRequestURL().toString().replace(request.getRequestURI().substring(1), request.getContextPath()); %>
<link href="<% out.print(baseURL);%>/view/template/css/main.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="<% out.print(baseURL);%>/view/template/js/jquery.js"></script>
<script type="text/javascript" src="<% out.print(baseURL);%>/view/template/js/jquery-ui.min.js"></script>
<link href="<% out.print(baseURL);%>/view/template/css/jquery-ui.css" rel="stylesheet">

<script>
	$(function() {
		$( "#tabs" ).tabs();
	});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<s:set name="theme" value="'simple'" scope="page" />

</head>
<body>
	<div id="wrapper">
		<div id="header">
			<div class="header-up-part">
				<div class="logo">
					<a href="#"><img src="<% out.print(baseURL);%>/view/template/images/logo.jpg" alt="logo" />
					</a>
				</div>
				<ul>
				<sec:authorize ifAnyGranted="ROLE_USER">
                
      
					<li>Welcome <strong><sec:authentication
								property="principal.name" />
					</strong>
					</li>
  </sec:authorize>
		<sec:authorize ifAnyGranted="ROLE_USER">
					<li><s:url action="my_profile" var="my_profile_action"/><a href="${my_profile_action}"><s:text name="my_profile"/></a>
					</li>
</sec:authorize>
<sec:authorize ifAnyGranted="ROLE_USER">
					<li><c:url value="/j_spring_security_logout" var="logoutUrl"/><a href="${logoutUrl}">LogOut</a>

					</li>
					</sec:authorize>
					<sec:authorize ifAnyGranted="ROLE_USER">
					<li><s:url var="english" includeParams="all">
							<s:param name="request_locale">en</s:param>
						</s:url> <a href="${english}"><s:text name="english" />
					</a></li>
					<li><s:url var="sinhala" includeParams="all">
							<s:param name="request_locale">si_LK</s:param>
						</s:url> <a href="${sinhala}"><s:text name="sinhala" />
					</a></li>
					</sec:authorize>
				</ul>
			</div> 
			<div class="menu-part">
				<ul>
				<sec:authorize ifAnyGranted="ROLE_ADMIN">
					<li><s:url action="create_users" var="create_users_action"/><a href="${create_users_action}"><s:text name="menu.system_admin"/></a></li>
					</sec:authorize>
					<sec:authorize ifAnyGranted="ROLE_ADMITTING_OFFICER,ROLE_DOCTOR,ROLE_NURSE" >
					<li><s:url action="search_patient" var="search_patient_action"/><a href="${search_patient_action}"><s:text name="menu.patient_registration_ehr"/></a></li>
					</sec:authorize>
					<sec:authorize ifAnyGranted="ROLE_PHARMACIST">
					<li><s:url action="request_drugs" var="request_drugs_action"/><a href="${request_drugs_action}"><s:text name="menu.supply_chain"/></a></li>
				</sec:authorize>
				</ul>
			</div>
		</div>
	
</body>
</html>